Implemented gaus functions calculation