Lots of fixes.
Introduced getRequiredExp method.
General cleanup.