removed redundant code and made system more fair