fixed buggy version of aasignment 3