my attempts at medium/hard problems