working on weapons. stuck on mathematical problem