partially works, but there are a couple of mistakes