added rank system and code structure