Removed Debug code and added structure