Cleaned up code for ruled note paper