Implemented Fed forward and cost function - correct upload