added comments and compatibility to newly added functions