first version; totally not complete.