implemented getters, cleaned up code, misc. fixes.