Some functionality added (not tested)