Miscellaneous problems added and common function library added, solutions verified