Merge pull request #6 from tarunbhardwaj/develop

Separate weight calculation from function field