added code, got rid of magic numbers