did a little refactoring and added the concept of specially marked points