code compiles. needs to be tested