fix/corrects a really bad implementation of functionality