Final assignment fixed bugs