various changes, and main classes implemented for testing