major overhaul

completely restructured code. removed cc attribute limitation.