fixed build error, added namespace, changes acording to code review, changed code styling in some places