added dependency tracking for build. build is now much faster. Though it could still be improved