Implemented buggy version of task 8