added bias term and computed additional derivations