really intermediate version from the hackathong