removed unecessary variable and fixed a magic number