closed #7, closed #14, closed #21 and closed #22