still cleaning up the code