added class CFs and fixed bugs