my solution is messy