pre working version

back-end is refactored