General framework done, require testing