fixed evaluation mistakes
fixed mistake in evaluation of functions