Fixed bug in costFunc