[DEV] working version

there might be some logical bugs ?