code clean up and battle half done