now using scala futures and for syntax to get better performance