almost finished for coding part