working initial version
buggy but working first version