basic implementation done for the whole thing