proto done, testing and optimization remaining
printing method in class added for testing
minute mistakes removed