Added print function + fixed a few mistakes