All working, need code cleaning