Initial commit of cleaned up code