Functionality seems okay. Code needs to be cleaned and tested before merge!