Commented code and removed magic numbers. The new curses functions are working now.