Unusued code and commentaries removed