added all remaining funcionality