added functionality for new, save as and open