Added configuration, fixed stuff, code cleanup