Replaced thisAmount with method call - Replace Temp with Query