works on implementing main