Added surface (it is not fully implemented); A little refactoring of the code