having trouble with transferring information from constructor to method