Cleaned up biasing code