divided into more files, worked on event handler, still has bug with default