updaed directory structure, cleaned up code