Added print formatting and some fixes