fixed bug in feed_forward function. Now it handles small dataset
correctly.