working version w/o database