debuged the test lucky function