added basic logging and error handling, added prevoius files