added comments and use method in gauss instead of class